<!--  -->
<template>
  <div class>
    <van-nav-bar title="充值" left-arrow @click-left="onClickLeft">
      <!-- <template #right>
        <van-icon name="search" size="18" />
      </template>-->
    </van-nav-bar>

    <!-- <div class="charge_box">
      <p class="charge_tit">充值金额</p>
      <van-cell-group class="cell-group">
        <van-field v-model="charge_value" label="¥" clearable placeholder="最少充值1元" />
      </van-cell-group>
      <p class="other_money">可用余额：¥8.00</p>
    </div> -->
    <chargeComp :title="'充值金额'"></chargeComp>

    <div class="bgfff">
      <div class="charge_num">
        <div class="item">100元</div>
        <div class="item">100元</div>
        <div class="item">
          <span class="react">+2%返利</span>
          <!-- <img class="react" src="../../assets/vip/react.png" alt=""> -->
          100元
        </div>
        <div class="item"><span class="react">+2%返利</span>100元</div>
        <div class="item"><span class="react">+2%返利</span>100元</div>
        <div class="item">100元</div>
      </div>

      <!-- 支付方式 -->
      <div class="pay_methods">
        <p class="pay_tit">
          选择充值方式
          <span style="color:#BDBDBD">(单笔满3000以上2%返利优惠</span>）
        </p>

        <van-radio-group v-model="radio">
          <van-cell-group>
            <van-cell title="支付宝" clickable @click="radio = '1'">
              <template #title>
                <span class="pay_item"><img src="../../assets/vip/zhifubao.png" alt="">支付宝</span>
              </template>
              <template #right-icon>
                <van-radio name="1" />
              </template>
            </van-cell>
            <van-cell title="微信" clickable @click="radio = '2'">
              <template #title>
                <span class="pay_item"><img src="../../assets/vip/wechat.png" alt="">微信</span>
              </template>
              <template #right-icon>
                <van-radio name="2" />
              </template>
            </van-cell>
            <van-cell title="银行卡" clickable @click="radio = '3'">
              <template #title>
                <span class="pay_item"><img src="../../assets/vip/card.png" alt="">银行卡</span>
              </template>
              <template #right-icon>
                <van-radio name="3" />
              </template>
            </van-cell>
          </van-cell-group>
        </van-radio-group>

        <van-button class="btn_charge" :disabled="btn_disable" type="danger">立即充值</van-button>
      </div>
    </div>
  </div>
</template>

<script>
//这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
//例如：import 《组件名称》 from '《组件路径》';
import chargeComp from '../../components/chargeComp.vue'

export default {
  //import引入的组件需要注入到对象中才能使用
  components: {
    name: "charge",
    chargeComp,
  },
  data() {
    //这里存放数据
    return {
      loading: true,
      radio:'',
      charge_value: "",
      // btn_disable:true
    };
  },
  //监听属性 类似于data概念
  computed: {
    btn_disable(){
// charge_value&&radio
      if(this.charge_value&&this.radio){
        return false
      }else{
        return true
      }
    }
  },
  //监控data中的数据变化
  watch: {},
  //方法集合
  methods: {
    onClickLeft() {
      // Toast('返回');
      this.$router.go(-1)
    },
  },
  //生命周期 - 创建完成（可以访问当前this实例）
  created() {},
  //生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {},
  beforeCreate() {}, //生命周期 - 创建之前
  beforeMount() {}, //生命周期 - 挂载之前
  beforeUpdate() {}, //生命周期 - 更新之前
  updated() {}, //生命周期 - 更新之后
  beforeDestroy() {}, //生命周期 - 销毁之前
  destroyed() {}, //生命周期 - 销毁完成
  activated() {} //如果页面有keep-alive缓存功能，这个函数会触发
};
</script>
<style  scoped>
/* //@import url(); 引入公共css类 */
.charge_box {
  width: 375px;
  height: 132px;
  background: #fff;
  /* border-radius: 10px; */
  /* box-shadow: 0px 20px 20px 0px #fff2f0; */
  margin: auto;
  margin-top: 15px;
}
.charge_tit {
  font-size: 16px;
  font-weight: 400;
  color: #5f5f5f;
  line-height: 22px;
  padding: 10px 10px;
}
.other_money {
  font-size: 13px;
  font-weight: 400;
  color: #ff4a35;
  line-height: 18px;
  padding: 10px 10px;
}
.cell-group {
  width: 100%;
  height: 42px;
  /* background: #f7f7f7; */
  /* border-bottom: 1px solid #f7f7f7; */
  border-radius: 3px;
  /* margin: auto; */
}
.cell-group .van-cell {
   /* border-bottom: 1px solid #f7f7f7; */
  border-radius: 4px;
}
.bgfff {
  background: #fff;
}
.charge_num {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 0 14px;
  margin-top: 15px;
}
.charge_num .item {
  /* flex: 1; */
  width: 106px;
  height: 56px;
  border: 1px solid #ebebeb;
  border-radius: 2px;
  font-size: 15px;
  font-weight: 500;
  color: #3a3a3a;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  margin-top: 15px;
}
.react {
  width: 76px;
  height: 24px;
  position: absolute;
  right: 0;
  top: -12px;
  background: url("../../assets/vip/react2.png") no-repeat;
  background-size: 100% 100%;
  text-align: center;
  font-size: 12px;
  color: #fff;
  line-height: 20px;
      display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
}
.pay_item{
display: flex;
align-items: center;

}
.pay_item img{
  width: 22px;
  height: 22px;
  margin-right: 8px;
}
.pay_methods {
  padding: 0px 14px 20px 14px;
  /* margin-top: 20px; */
}
.pay_tit {
  font-size: 13px;
  font-weight: 500;
  color: #3e3e3e;
  line-height: 18px;
  padding: 20px 0;
}
.btn_charge{
  width: 318px;
height: 50px;
margin: auto;
display: block;
background: linear-gradient(180deg,#ff3927, #ff6b4f 133%);
border-radius: 5px;
box-shadow: 0px 2px 4px 0px #ffd9d4; 
margin-top: 20px;
}
</style>